<%--
  Created by IntelliJ IDEA.
  User: 18114
  Date: 2022/10/28
  Time: 14:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
  <head>
    <title>$Title$</title>
    <script src="js/jquery-3.1.1.min.js"/>
  </head>
  <body>

    <table>
      <tr>
        <td>编号</td>
        <td>车型</td>
        <td>所属城市</td>
        <td>使用单位</td>
        <td>压差报警值</td>
        <td>报警时间</td>
        <td>操作</td>
      </tr>
  <c:forEach items="${requestScope.list}" var="list">
      <tr>
        <td><a href="PwbtyServlet?arr=3&id=${list.id}">${list.id}</a></td>
        <td>${list.citName}</td>
        <td>${list.carName}</td>
        <td>${list.userName}</td>
        <td>${list.pressureValue}</td>
        <td>${list.time}</td>
        <td><a href="a(${list.id})">删除</a></td>
      </tr>
  </c:forEach>
    </table>
  </body>
<script>

    function a(id){
      if (confirm("确定要删除吗？")) {
        $.push("PwbtyServlet?arr2", "id=" + id, function (data) {
          if (data == "true") {
            alert("删除成功")
          } else {
            alert('删除失败')
          }
        })
      }
    }
</script>
</html>
